package com.heima.App;

import com.heima.dao.BookDao;
import com.heima.pojo.Student;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppStudent {
        public static void main( String[] args ) {
            ClassPathXmlApplicationContext ctx =
                    new ClassPathXmlApplicationContext("applicationContext-Student.xml");

            Student student = (Student) ctx.getBean("student");
            student.getId();
            //注册关闭钩子函数，在虚拟机退出之前回调此函数，关闭容器
            ctx.registerShutdownHook();
            //关闭容器
            //ctx.close();
        }
}
